home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lang_c
/
bc_ti
/
ti708.asc
< prev
next >
Wrap
Text File
|
1992-02-24
|
2KB
|
67 lines
PRODUCT : Borland C++ NUMBER : 708
VERSION : 2.0
OS : DOS
DATE : February 25, 1992 PAGE : 1/1
TITLE : How to Warm or Cold Boot Computer
/********************************************************************
This code will let the user specify whether to perform a cold or
warm boot based on the command line option (Warm boot: 'W' or
'S'; any other character results in a cold boot).
*********************************************************************/
#include <stdio.h>
#include <dos.h>
#include <ctype.h>
int main (int argc, char *argv[])
{
void (far *bootsystem) (void);
if ((toupper (argv[1][0]) == 'W')
|| (toupper (argv[1][0]) == 'S'))
{ /* Setting this memory location to this value will result
in memory not being checked a.k.a. Warm Boot */
unsigned far *warm;
/* Make a far pointer that points to the specified memory
location that is checked when the system is rebooted */
warm = MK_FP (0x0000, 0x0472);
/* Assign constant to farpointer indicating that memory is
not to be checked
*/
*warm = 0x1234;
puts ("\nWarm boot in progress...\n");
}
else /* memory will be checked a.k.a. Cold Boot */
puts ("\nCold boot in progress...\n");
/* Assign far function pointer to the required far pointer
for reboot */
bootsystem = MK_FP (0xFFFF, 0x0000);
/* Invoke the reboot process */
(*bootsystem) ();
return (0);
}